<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/commons/taglibs.jsp"%>
<!-- 分页显示演示开始 -->
<form id="listForm" class="well form-search" action="${ctx}/adoms/order/myOrderlist" method="get">
	<input type="hidden" name="pageNo" id="pageNo" value="${pageData.pagination.pageNo}" />
	<input type="hidden" name="fieldName" id="fieldName" value="${pageData.compositor.fieldName}" />
	<input type="hidden" name="compositorType" id="compositorType" value="${pageData.compositor.compositorType}" />
	<table class="table table-striped table-bordered table-condensed">
		<tr align="center">
			<th>
				订单编号|订单名称
				<y:search fieldType="S" fieldList="name,code" matchType="LIKE" className="input-medium search-query" />
				<button class="btn btn-small" onclick="search()" type="button">
					<i class="icon-search"></i>
					搜索
				</button>
				<a href="${ctx}/adoms/order/order" class="btn btn-small right">
					<i class="icon-heart"></i>
					我要下单
				</a>
			</th>
		</tr>
	</table>
</form>
<table class="table table-striped table-bordered table-condensed">
	<thead>
		<tr>
			<th>#</th>
			<th>
				<a href="javascript:sort('code')">订单编号</a>
			</th>
			<th>
				<a href="javascript:sort('marchandise')">商品</a>
			</th>
			<th>
				<a href="javascript:sort('marchandise')">单价(元)</a>
			</th>
			<th>
				<a href="javascript:sort('goodsNumber')">数量(件)</a>
			</th>
			<th>
				<a href="javascript:sort('totalCost')">总价(元)</a>
			</th>
			<th>
				<a href="javascript:sort('orderCreateTime')">下单时间</a>
			</th>
			<th>
				<a href="javascript:sort('status')">订单状态</a>
			</th>
			<th>
				<a href="javascript:sort('departmentTarget')">发货部门</a>
			</th>
			<th>
				<a href="javascript:sort('createUser')">联系人</a>
			</th>
			<th>
				<a href="javascript:sort('phone')">联系电话</a>
			</th>
			<th align="center">操作</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach var="entity" items="${pageData.result}" varStatus="index">
			<tr <c:if test="${!entity.visible}">bgcolor="#AFEEEE"</c:if>>
				<td>${index.index + 1}</td>
				<td>
					<a href="${ctx}/adoms/goods/orderGoods?orderId=${entity.id}"> ${entity.code}</a>
				</td>
				<td>${entity.marchandise.name}</td>
				<td>${entity.marchandise.price}</td>
				<td class="tRed">${entity.goodsNumber}</td>
				<td class="tRed">
					<fmt:formatNumber value="${entity.totalCost}" pattern="###,###.##"></fmt:formatNumber>
				</td>
				<td>
					<fmt:formatDate value="${entity.orderCreateTime}" pattern="yyyy-MM-dd HH:mm:ss" />
				</td>
				<td>${entity.status.value}</td>
				<td>${entity.departmentTarget.name}</td>
				<td>${entity.createUser}</td>
				<td>${entity.phone}</td>
				<td align="center">
					<c:if test="${entity.status.value != '已收货'}">
						<a href="${ctx}/adoms/goods/orderGoods?orderId=${entity.id}">${entity.status.value == '已发货' ? '确认收货':''}</a>
						<%-- 						<a href="${ctx}/adoms/order/myEdit/${entity.id}">${entity.status.value == '已发货' ? '确认收货':'修改'}</a> --%>
					|
					</c:if>
					<c:if test="${entity.status.value == '已提交'}">
						<a href="${ctx}/adoms/order/myDelete/${entity.id}" confirm="删除后无法恢复,确定要删除吗?">刪除</a>
					|
					</c:if>
					<a href="${ctx}/adoms/order/view/${entity.id}">查看</a>
				</td>
			</tr>
		</c:forEach>
	</tbody>
</table>
<%@ include file="/WEB-INF/jsp/commons/pager.jsp"%>